import service from '@/core/net/request'

export function getCouponList(page) {
  return service.get(`/api/admin/coupon/${page}`)
}

export function createCoupon(data) {
  return service.post('/api/admin/coupon', data)
}

export function updateCoupon(id, data) {
  return service.post('/api/admin/coupon/' + id, data)
}

export function deleteCoupon(id) {
  return service.post(`/api/admin/coupon/${id}/delete`)
}

export function updateCouponStatus(id) {
  return service.post(`/api/admin/coupon/${id}/update_status`, {
    status: 0,
  })
}
